package com.tubeonfire.entity;

import java.io.Serializable;
import java.util.Calendar;
import java.util.Date;

import javax.persistence.Id;

import com.googlecode.objectify.annotation.Cached;
import com.googlecode.objectify.annotation.Indexed;
import com.googlecode.objectify.annotation.Unindexed;

@Cached
public class Playlist implements Serializable {

	public static final long serialVersionUID = 1L;
	@Id
	private String id = "";

	@Unindexed
	private String title = "";

	@Indexed
	private String alias = "";

	@Unindexed
	private String description = "";

	@Unindexed
	private String imageKey = "";

	@Indexed
	private int tubeCount = 0;

	@Indexed
	private Date indexDate = Calendar.getInstance().getTime();

	@Indexed
	private Date doc = Calendar.getInstance().getTime();

	@Indexed
	private Date updated = Calendar.getInstance().getTime();

	@Indexed
	private int status = 0;

	public String getSubTitle() {
		if (this.title.length() > 24) {
			String subString = this.title.substring(0, 24);
			return (subString + "...");
		} else {
			return this.title;
		}
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getAlias() {
		return alias;
	}

	public void setAlias(String alias) {
		this.alias = alias;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getImageKey() {
		return imageKey;
	}

	public void setImageKey(String imageKey) {
		this.imageKey = imageKey;
	}

	public int getTubeCount() {
		return tubeCount;
	}

	public void setTubeCount(int tubeCount) {
		this.tubeCount = tubeCount;
	}

	public Date getIndexDate() {
		return indexDate;
	}

	public void setIndexDate(Date indexDate) {
		this.indexDate = indexDate;
	}

	public Date getDoc() {
		return doc;
	}

	public void setDoc(Date doc) {
		this.doc = doc;
	}

	public Date getUpdated() {
		return updated;
	}

	public void setUpdated(Date updated) {
		this.updated = updated;
	}

	public int getStatus() {
		return status;
	}

	public void setStatus(int status) {
		this.status = status;
	}

}
